//
//  StoresNearbyModel.m
//  TerritoryShopkeeper
//
//  Created by 李小龙 on 2017/12/19.
//  Copyright © 2017年 ZDQK. All rights reserved.
//

#import "StoresNearbyModel.h"

@implementation StoresImgModel

MJCodingImplementation
@end

@implementation StoresGoodModel

MJCodingImplementation
+ (NSDictionary *)mj_objectClassInArray {
    return @{@"twoattribute":[AttributeModel class],
             @"goodsattribute":[GoodsAttributePriceModel class],
             @"attribute":[GoodAttributeModel class],
             @"goodsimg":[StoresImgModel class]};
}
- (NSString *)count {
    NSInteger allCount = 0;
    for (GoodsAttributePriceModel *tempModel in self.goodsattribute) {
        allCount += tempModel.selectNumber.integerValue;
    }
    _count = [NSString stringWithFormat:@"%ld",(long)allCount];
    return _count;
}
- (NSString *)gprice {
    _gprice = [_gprice replacePriceSuffix];
    return _gprice;
}
- (NSString *)goldprice {
    _goldprice = [_goldprice replacePriceSuffix];
    return _goldprice;
}
@end

@implementation StoresNearbyModel

MJCodingImplementation
+ (NSDictionary *)mj_objectClassInArray {
    return @{@"goods":[StoresGoodModel class]};
}
- (NSString *)number {
    NSInteger allCount = 0;
    for (StoresGoodModel *tempModel in self.goods) {
        allCount += tempModel.count.integerValue;
    }
    _number = [NSString stringWithFormat:@"%ld",(long)allCount];
    return _number;
}
@end
